/*
* SMILParser
*
* Version 1.0
*
* Programmers: Jesse Louderback, Noah Pham, Chad Carpenter, and Marc Hindman
*/
package comm;

import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

public class SMS_Service extends Service {
	private static final String ACTION = "android.provider.Telephony.SMS_RECEIVED"; 
	SMS_Listener listen;
	
	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}


	@Override
	public void onCreate() {
		NotificationManager notificationMgr = 
				(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		Notify notice = new Notify(this, notificationMgr);
		final IntentFilter theFilter = new IntentFilter(); 
        theFilter.addAction(ACTION);
        listen = new SMS_Listener();
		listen.setNotificationMrg(notice);
		listen.setContext();
		this.registerReceiver(listen, theFilter);
		super.onCreate();
	}

	@Override
	public void onDestroy() {
		this.unregisterReceiver(listen);
		super.onDestroy();
	}

	@Override
	public void onStart(Intent intent, int startid) {}
}
